package com.neusoft.dibuy.myarray;

import java.util.Arrays;

public class ShellSort {
    public static void main(String[] args) {
        int [] is =  { 7,9,6,2,5,1,0,3,10,4 ,8};
        System.out.println(Arrays.toString(is));
        int step =    5  ;//  is.length /2;
        for (int i = 0; i +  step < is.length; i++){
            if (is[i] > is[i + step]){
                int temp = is[i];
                is[i] = is[i + step];
                is[i + step] = temp;
            }
        }
        System.out.println(Arrays.toString(is));

        step =    4  ;//  is.length /2;
        for (int i = 0; i +  step < is.length; i++){
            if (is[i] > is[i + step]){
                int temp = is[i];
                is[i] = is[i + step];
                is[i + step] = temp;
            }
        }
        System.out.println(Arrays.toString(is));




    }
}
